use crate::src::struct_and_type::UnitTestFunction;
use crate::src::test::alloc_testing::{alloc_test_get_allocated, alloc_test_set_limit};

extern "C" fn run_test(mut test: UnitTestFunction) {
    alloc_test_set_limit(-(1 as i32));
    (unsafe { test.expect("non-null function pointer")() });
    assert!(alloc_test_get_allocated() == 0 as u64);
}
#[no_mangle]
pub extern "C" fn run_tests(mut tests: *mut UnitTestFunction) {
    let mut i: i32 = 0;
    i = 0;
    while unsafe { (*tests.offset(i as isize)).is_some() } {
        run_test(unsafe { *tests.offset(i as isize) });
        i += 1;
        i;
    }
}
